package com.gbb.simple.ui;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;

import com.gbb.simple.R;
import com.gbb.simple.utils.TouchEventUtil;

/**
 * Touch事件分发
 *
 * @author Administrator on 2016/12/27.
 */
public class TouchEventActivity extends Activity {

    private static final String TAG = TouchEventActivity.class.getSimpleName();

    @Override
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.touchevent_activity);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev){
        Log.e(TAG,"dispatchTouchEvent --> " + TouchEventUtil.getTouchAction(ev.getAction()));
        return super.dispatchTouchEvent(ev);
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev){
        Log.d(TAG,"onTouchEvent --> " + TouchEventUtil.getTouchAction(ev.getAction()));
        return super.onTouchEvent(ev);
    }

}
